package org.dromara.germbank.domain;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import io.swagger.v3.oas.annotations.media.Schema;
import org.hibernate.validator.constraints.Length;



import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 广告表
 * 数据库表名：bus_advertisement
 */
@Data
@TableName("bus_operations_advertisement")
public class BusOperationsAdvertisement implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableField("id")
    @NotNull(message = "主键id不能为空")
    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer id;

    @TableField("name")
    @NotBlank(message = "广告名称不能为空")
    @Length(max = 100, message = "广告名称长度不能超过100")
    @Schema(description = "广告名称，后台识别用", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @TableField("page")
    @NotBlank(message = "广告所在页面不能为空")
    @Size(max = 50, message = "广告所在页面长度不能超过50")
    @Length(max = 50, message = "广告所在页面长度不能超过50")
    @Schema(description = "广告所在页面，如首页", requiredMode = Schema.RequiredMode.REQUIRED)
    private String page;

    @TableField("position")
    @NotBlank(message = "广告位属性不能为空")
    @Size(max = 50, message = "广告位属性长度不能超过50")
    @Length(max = 50, message = "广告位属性长度不能超过50")
    @Schema(description = "广告位属性，如Hero", requiredMode = Schema.RequiredMode.REQUIRED)
    private String position;

    @TableField("material_url")
    @NotBlank(message = "素材文件路径或URL不能为空")
    @Size(max = 255, message = "素材文件路径或URL长度不能超过255")
    @Length(max = 255, message = "素材文件路径或URL长度不能超过255")
    @Schema(description = "素材文件路径或URL", requiredMode = Schema.RequiredMode.REQUIRED)
    private String materialUrl;

    @TableField("landing_url")
    @NotBlank(message = "落地页链接不能为空")
    @Size(max = 255, message = "落地页链接长度不能超过255")
    @Length(max = 255, message = "落地页链接长度不能超过255")
    @Schema(description = "点击后跳转的落地页链接", requiredMode = Schema.RequiredMode.REQUIRED)
    private String landingUrl;

    @TableField("start_time")
    @NotNull(message = "广告开始展示时间不能为空")
    @Schema(description = "广告开始展示时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime startTime;

    @TableField("end_time")
    @NotNull(message = "广告结束展示时间不能为空")
    @Schema(description = "广告结束展示时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime endTime;

    @TableField("sort_weight")
    @NotNull(message = "排序权重不能为空")
    @Schema(description = "排序权重，越大越靠前", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer sortWeight;

    @TableField("create_time")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField("update_time")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @TableField("del_flag")
    @Schema(description = "删除标志：0-存在，1-删除")
    private Integer delFlag;


}
